home *** CD-ROM | disk | FTP | other *** search
- head 1.7;
- branch ;
- access ;
- symbols ;
- locks ;
- comment @ * @;
-
-
- 1.7
- date 92.03.01.05.07.33; author melling; state Exp;
- branches ;
- next 1.6;
-
- 1.6
- date 92.02.29.20.35.41; author melling; state Exp;
- branches ;
- next 1.5;
-
- 1.5
- date 92.02.28.05.18.51; author melling; state Exp;
- branches ;
- next 1.4;
-
- 1.4
- date 91.12.19.10.12.35; author melling; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 91.12.16.17.22.01; author melling; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 91.12.07.07.48.58; author melling; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 91.12.07.03.36.51; author melling; state Exp;
- branches ;
- next ;
-
-
- desc
- @Tetris 1.1
- @
-
-
- 1.7
- log
- @*** empty log message ***
- @
- text
- @
- #import <objc/Object.h>
-
- #define MAX_SHAPE_SIZE 4
- #define PIECE_INFO_NULL (struct pieceInfo *)0
- #define NUM_BITMAPS 4
-
- struct shape {
- unsigned char table[4][4];
- unsigned char bounds[4];
- unsigned char points[4];
- };
-
- struct pieceInfo {
- id bitmap;
- int shape;
- int rotation;
- };
-
- @@interface Piece:Object
- {
- int curRow, curCol; // The Block's position
- id bitmap; // The image used to build the block
- unsigned char *currentPiece;
- struct shape *currentShape;
- int shapenum; // The Shape that we are currently dropping
- int currentRotation;
- int dropPoints; // Bonus points for dropping the piece
- NXSize blockSize;
- NXSize intercell;
- NXRect invalidRect;
-
- BOOL viewVarsInited;
- id anmShape;
- id anmBackground; // The animation background
- struct shape shapes[7];
- id blockImage[NUM_BITMAPS]; // Holds the id for each block image.
- }
-
- - init;
-
- - draw:sender;
- - (BOOL)reset:sender piece:(struct pieceInfo *)info;
- - newPiece;
- - (struct pieceInfo *)pieceInfo;
- - setPiece:(struct pieceInfo *)info;
-
- - (BOOL)legalMove:sender :(int)row :(int)column rotation:(int)rotation;
-
- - left:sender;
- - right:sender;
-
- - getInvalidRect:(NXRect *)aRect for:sender;
- - point:(NXPoint *)thePoint for:(int)row :(int)column;
- - (int)points;
- - getBlockSize:(NXSize *) size;
- - getBlockImage:(int) blockNum;
-
- - drop:sender;
- - (BOOL)down:sender;
- - turn:sender;
- - stick:sender;
-
- - (int)getCurRow;
-
- - free;
-
- @@end
- @
-
-
- 1.6
- log
- @*** empty log message ***
- @
- text
- @d57 1
- @
-
-
- 1.5
- log
- @*** empty log message ***
- @
- text
- @d29 1
- a29 1
- NXSize bitmapSize;
- d56 1
- @
-
-
- 1.4
- log
- @*** empty log message ***
- @
- text
- @d6 1
- d37 1
- @
-
-
- 1.3
- log
- @*** empty log message ***
- @
- text
- @a22 1
- id aCheater; // The Cheater Object
- a35 1
- BOOL cheating; // Determine the next piece from a Panel
- @
-
-
- 1.2
- log
- @Tetris 1.2
- @
- text
- @d21 3
- a23 2
- int x, y;
- id bitmap;
- d28 1
- a28 1
- int dropPoints;
- d35 1
- a35 1
- id anmBackground;
- d37 1
- d62 1
- a62 1
- - (int)y;
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d25 1
- a25 1
- int shapenum;
- @
-